home *** CD-ROM | disk | FTP | other *** search
/ PC Player 2004 May / pc player 2004-05.iso / Demos / FarCry / Data1.cab / _FEEA9BCD8AA74ACA8612FA120CD008D1 < prev    next >
Encoding:
Text File  |  2004-01-06  |  4.3 KB  |  112 lines

  1. --------------------------------------------------
  2. --    Created By: Kirill
  3. --   Description: This is the combat behaviour of the hellicopter gunner 
  4. --------------------------
  5. --   Modyfied By: 
  6.  
  7. AIBehaviour.Gunner = {
  8.     Name = "Gunner",
  9.  
  10.     -- SYSTEM EVENTS            -----
  11.     ---------------------------------------------
  12.     OnSelected = function( self, entity )    
  13.     
  14.     end,
  15.     ---------------------------------------------
  16.     OnSpawn = function( self, entity )
  17.         -- called when enemy spawned or reset
  18.         entity.cnt.AnimationSystemEnabled = 1;
  19.     end,
  20.     ---------------------------------------------
  21.     OnActivate = function( self, entity )
  22.         -- called when enemy receives an activate event (from a trigger, for example)
  23.     end,
  24.     ---------------------------------------------
  25.     OnNoTarget = function( self, entity )
  26.         -- called when the enemy stops having an attention target
  27.         entity:SelectPipe(0,"h_gunner_no_fire");        
  28.     end,
  29.     ---------------------------------------------
  30.     OnPlayerSeen = function( self, entity, fDistance )
  31.         -- called when the enemy sees a living player
  32.         --AI:Signal(SIGNALID_READIBILITY, 1, "ENEMY_TARGET_REGAIN",entity.id);
  33.         
  34.         entity:SelectPipe(0,"h_gunner_fire");
  35. --        if (self.Status == "choose") then
  36. --            if (fDistance>10) then
  37. --                entity:SelectPipe(0,"cover_pindown");
  38. --            else
  39. --                entity:SelectPipe(0,"cover_scramble");
  40. --            end
  41. --        end
  42.     end,
  43.     ---------------------------------------------    
  44.     OnGrenadeSeen = function( self, entity, fDistance )
  45. --    InsertSubpipe
  46. System:LogToConsole( "Gunner sees the grenade -------------------------------------------------------------" );
  47.         entity:SelectPipe(0,"h_gunner_ignore");
  48.     end,
  49.     ---------------------------------------------
  50.     OnEnemySeen = function( self, entity )
  51.         -- called when the enemy sees a foe which is not a living player
  52.     end,
  53.     ---------------------------------------------
  54.     OnFriendSeen = function( self, entity )
  55.         -- called when the enemy sees a friendly target
  56.     end,
  57.     ---------------------------------------------
  58.     OnDeadBodySeen = function( self, entity )
  59.         -- called when the enemy a dead body
  60.     end,
  61.     ---------------------------------------------
  62.     OnEnemyMemory = function( self, entity )
  63.         -- called when the enemy can no longer see its foe, but remembers where it saw it last
  64.             
  65.     end,
  66.     ---------------------------------------------
  67.     OnInterestingSoundHeard = function( self, entity )
  68.         -- called when the enemy hears an interesting sound
  69.     end,
  70.     ---------------------------------------------
  71.     OnThreateningSoundHeard = function( self, entity )
  72.         -- called when the enemy hears a scary sound
  73.     end,
  74.     ---------------------------------------------
  75.     ---------------------------------------------
  76.     OnGroupMemberDied = function( self, entity )
  77.         -- called when a member of the group dies
  78.     end,
  79.     ---------------------------------------------
  80.     --------------------------------------------------
  81.     ---------------------------------------------
  82.     ---------------------------------------------
  83.     OnReceivingDamage = function ( self, entity, sender)
  84.         -- called when the enemy is damaged
  85.     end,
  86.     ---------------------------------------------
  87.     OnCoverRequested = function ( self, entity, sender)
  88.         -- called when the enemy is damaged
  89.     end,
  90.     --------------------------------------------------
  91.     OnBulletRain = function ( self, entity, sender)
  92.         -- called when the enemy detects bullet trails around him
  93.     end,
  94.     --------------------------------------------------
  95.     OnDeath = function ( self, entity, sender)
  96.         entity.cnt.AnimationSystemEnabled = 1;
  97.         System:LogToConsole("GroupCount:  "..AI:GetGroupCount(entity.Properties.groupid));
  98.         if (AI:GetGroupCount(entity.Properties.groupid)== 2) and (entity.Properties.ReinforcePoint ~= "none") then
  99.                 AI:Signal(SIGNALFILTER_NEARESTGROUP, 1, "GoForReinforcement",entity.id);
  100.         else    
  101.             AI:Signal(SIGNALFILTER_NEARESTGROUP, 1, "OnGroupMemberDiedNearest",entity.id); 
  102.             AI:Signal(SIGNALFILTER_GROUPONLY, 1, "OnGroupMemberDiedA",entity.id);
  103.         end
  104.     end,
  105.     --------------------------------------------------
  106.     --------------------------------------------------
  107.     --------------------------------------------------
  108.     --------------------------------------------------
  109.     ---------------------------------------------
  110.     ---------------------------------------------    
  111.     ------------------------------------------------------------------------
  112. }